package com.bj.dz.controller;

import com.bj.dz.entity.WaterfactoryDataformat;
import com.bj.dz.service.WaterfactoryDataformatService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/***
*   控制器
*/
@Api(tags = "【waterfactoryDataformat】提供服务接口")
@RestController
@RequestMapping("/waterfactoryDataformat")
public class WaterfactoryDataformatController {

    @Resource
    private WaterfactoryDataformatService waterfactoryDataformatService;

    /**
    * 通过id查询
    * @param
    * @return
    */
    @ApiOperation(value = "查找服务")
    @RequestMapping(value="/findById",method = RequestMethod.POST, produces = "application/json;" +"charset=UTF-8")
    public WaterfactoryDataformat findWaterfactoryDataformatById(@ApiParam(name = "id",value = "WaterfactoryDataformat的id",required = true) @RequestParam(value = "id",required=true)Integer id){
        return waterfactoryDataformatService.getWaterfactoryDataformatById(id);
    }

    /**
    * 通过多个查询
    * @param
    * @return
    */
    @ApiOperation(value = "查找多个服务")
    @RequestMapping(value="/findWaterfactoryDataformats",method = RequestMethod.POST, produces = "application/json;" +"charset=UTF-8")
    public List<WaterfactoryDataformat> findWaterfactoryDataformatListByMap(@ApiParam(name = "WaterfactoryDataformat",value = "waterfactoryDataformat",required = true)@RequestBody WaterfactoryDataformat waterfactoryDataformat){

        return waterfactoryDataformatService.getWaterfactoryDataformatListByMap(null);
    }

    /**
    * 查询总数
    * @param
    * @return
    */
    @ApiOperation(value = "获取总数服务")
    @RequestMapping(value="/count",method = RequestMethod.POST, produces = "application/json;" +"charset=UTF-8")
    public Integer WaterfactoryDataformatCount(){
        return waterfactoryDataformatService.getWaterfactoryDataformatCountByMap(null);
    }

    /**
    * 添加保存
    * @param
    * @return
    */
    @ApiOperation(value = "添加服务")
    @RequestMapping(value="/add",method = RequestMethod.POST, produces = "application/json;" +"charset=UTF-8")
    public boolean addWaterfactoryDataformat(@ApiParam(name = "WaterfactoryDataformat",value = "waterfactoryDataformat对象",required = true)@RequestBody WaterfactoryDataformat waterfactoryDataformat){
            return waterfactoryDataformatService.addWaterfactoryDataformat(waterfactoryDataformat);
    }

    /**
    * 更新修改
    * @param
    * @return
    */
    @ApiOperation(value = "更新修改服务")
    @RequestMapping(value="/upd",method = RequestMethod.POST, produces = "application/json;" +"charset=UTF-8")
    public boolean modifyWaterfactoryDataformat(@ApiParam(name = "WaterfactoryDataformat",value = "waterfactoryDataformat对象",required = true)@RequestBody WaterfactoryDataformat waterfactoryDataformat){
        return waterfactoryDataformatService.modifyWaterfactoryDataformat(waterfactoryDataformat);
    }

    /**
    * 删除
    * @param
    * @return
    */
    @ApiOperation(value = "删除服务")
    @RequestMapping(value="/del",method = RequestMethod.POST, produces = "application/json;" +"charset=UTF-8")
    public boolean deleteWaterfactoryDataformatById(@ApiParam(name = "WaterfactoryDataformat",value = "waterfactoryDataformat的id",required = true) @RequestParam(value = "id",required=true)Integer id){
        return waterfactoryDataformatService.deleteWaterfactoryDataformatById(id);
    }



}
